package com.nexus.all.model;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @ClassName: 用户等级表
 * @author MengLong_Ren
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@TableName(value = "nexus_user_levels", autoResultMap = true)
public class UserLevels {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("用户等级名称，如LV1、LV2、LV3...LV8")
    @TableField(value = "level_name")
    private String levelName;

    @ApiModelProperty("升级到该等级所需的最小经验值")
    @TableField(value = "min_experience")
    private Integer minExperience;

    @ApiModelProperty("升级到该等级所需的最小消费金额")
    @TableField(value = "min_spent_required")
    private BigDecimal minSpentRequired;

    @ApiModelProperty("达到此等级后享受的积分奖励比例")
    @TableField(value = "bonus_points_rate")
    private BigDecimal bonusPointsRate;

    @ApiModelProperty("用户特权描述，可以存储JSON格式的数据以便于扩展和查询")
    @TableField(value = "privileges")
    private String privileges;


    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @TableLogic
    @ApiModelProperty("是否删除")
    @TableField(value = "is_deleted")
    private Boolean isDeleted;
}
